from fastapi import APIRouter

from dao.es_dao.card_dao import get_card_list
from dao.mongo_dao.sys_depart import find_depart_by_name

card_router = APIRouter(prefix="/dataAnalysis/card", tags=["cards"])


@card_router.post("/getCards")
async def get_cards(data: dict):
    """获取卡片列表"""
    card_list = await get_card_list(data)
    return {"code": 200, "data": card_list}


@card_router.post("/getMembers")
async def get_members(data: dict):
    return find_depart_by_name(data["departName"])


async def create_card(request):
    return {"card": "card1"}


async def update_card(request):
    return {"card": "card1"}


async def delete_card(request):
    return {"card": "card1"}
